* Replication code for "If the shoe fits: Gender role congruity and evaluations of public managers" 
* Journal of Behavioral Public Administration, 2019
* Author: Kendall D. Funk (kendall.funk@asu.edu) 

version 13.1
use "Funk2019_Replication.dta", clear

*****************************
* Setting up some shortcuts * 
*****************************
global dem age reswoman resedu inccat resnonwhite resdemparty
global manip mggender_correct orgpurpose_correct mgrace_correct orgtype_correct orgsuccess_correct
global labels expwommg "Woman Manager" expfemorg "Feminine Org" 1.expwommg "Woman Manager" 1.expfemorg "Feminine Org" 1.expwommg#1.expfemorg "Woman Mg x Fem Org" 1.reswoman "Woman Respondent" 1.expwommg#1.reswoman "Woman Mg x Woman Res" 1.expfemorg#1.reswoman "Fem Org x Woman Res" 1.expwommg#1.expfemorg#1.reswoman "Wom Mg x Fem x Wom Res" 
global labelsdem age "Respondent Age" reswoman "Respondent Woman" resedu "Respondent Edu" inccat "Respondent Income" resnonwhite "Respondent Non-white" resdemparty "Respondent Dem. Party" 
global labelsmanip mggender_correct "Manager Gender Correct" mgrace_correct "Manager Race Correct" orgtype_correct "Org Type Correct" orgsuccess_correct "Org Success Correct" orgpurpose_correct "Org Purpose Correct" 

*******************************
* Data for Table 1 (Table A1) * 
*******************************
tab expfemorg expwommg 
tab expfemorg expwommg if reswoman==0
tab expfemorg expwommg if reswoman==1

************
* Table A2 *
************
sum expfemorg expwommg

************
* Table A3 *
************
sum factordv perform competent leadership fit contract

************
* Table A4 *
************
pwcorr factordv perform competent leadership fit contract, sig

************
* Table A5 *
************
factor perform competent leadership fit contract, pcf

************
* Table A6 *
************
sum age reswoman resedu inccat resnonwhite resdemparty

************
* Table A7 *
************
sum mggender_correct mgrace_correct orgtype_correct orgsuccess_correct orgpurpose_correct

************
* Table A8 *
************
tab mggender_correct 
tab mgrace_correct 
tab orgtype_correct 
tab orgsuccess_correct 
tab orgpurpose_correct

**********************
* Table 2 (Table A9) *
**********************
foreach dv in factordv perform competent leadership fit contract { 
reg `dv' expwommg expfemorg
eststo `dv'_1
}
estout factordv_1 perform_1 competent_1 leadership_1 fit_1 contract_1, ///
	cells(b(star fmt(3)) se(par))  ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels)

*************
* Table A10 * 
*************
foreach dv in factordv perform competent leadership fit contract { 
reg `dv' expwommg expfemorg $dem $manip
eststo `dv'_1a
}
estout factordv_1a perform_1a competent_1a leadership_1a fit_1a contract_1a, ///
	cells(b(star fmt(3)) se(par)) ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels $labelsdem $labelsmanip)

************************
* Figure 1 (Figure A1) * 
************************
reg factordv i.expwommg##i.expfemorg
eststo factordv_2
margins, over(expwommg expfemorg) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(-1.5(.5)1.5, angle(45) labsize(3.5) grid) ytitle("`: variable label factordv'", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12))  

* Pairwise comparisons test for Figure 1 
margins, over(expwommg expfemorg) level(95) pwcompare(effects)

*******************
* Figures A2 - A6 *
*******************  
foreach dv in perform competent leadership fit contract { 
reg `dv' i.expwommg##i.expfemorg
eststo `dv'_2
margins, over(expwommg expfemorg) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(1(1)10, angle(45) labsize(3.5) grid) ytitle("`: variable label `dv''", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12))
}

*************
* Table A11 * 
*************
estout factordv_2 perform_2 competent_2 leadership_2 fit_2 contract_2, ///
	cells(b(star fmt(3)) se(par)) ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels)

*************
* Figure A7 * 
*************
reg factordv i.expwommg##i.expfemorg $dem $manip
eststo factordv_2a
margins, over(expwommg expfemorg) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(-1.5(.5)1.5, angle(45) labsize(3.5) grid) ytitle("`: variable label factordv'", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) 

********************
* Figures A8 - A12 * 
********************
foreach dv in perform competent leadership fit contract { 
reg `dv' i.expwommg##i.expfemorg $dem $manip 
eststo `dv'_2a
margins, over(expwommg expfemorg) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(1(1)10, angle(45) labsize(3.5) grid) ytitle("`: variable label `dv''", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) 
}

*************
* Table A12 * 
*************
estout factordv_2a perform_2a competent_2a leadership_2a fit_2a contract_2a, ///
	cells(b(star fmt(3)) se(par)) ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels $labelsdem $labelsmanip)

*************************
* Figure 2 (Figure A13) *	
*************************
reg factordv i.expwommg##i.reswoman expfemorg 
eststo factordv_3
margins, over(expwommg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Man Respondent" 1 "Woman Respondent", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(-1.5(.5)1.5, angle(45) labsize(3.5) grid) ytitle("`: variable label factordv'", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) 

* Pairwise comparisons test for Figure 2
margins, over(expwommg reswoman) level(95) pwcompare(effects)

*********************
* Figures A14 - A18 * 
*********************
foreach dv in perform competent leadership fit contract { 
reg `dv' i.expwommg##i.reswoman expfemorg 
eststo `dv'_3
margins, over(expwommg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Man Respondent" 1 "Woman Respondent", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(1(1)10, angle(45) labsize(3.5) grid) ytitle("`: variable label `dv''", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) 
}

*************
* Table A13 * 
*************
estout factordv_3 perform_3 competent_3 leadership_3 fit_3 contract_3, ///
	cells(b(star fmt(3)) se(par)) ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels)

**************
* Figure A19 *
**************
reg factordv i.expwommg##i.reswoman expfemorg  $dem $manip 
eststo factordv_3a
margins, over(expwommg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Man Respondent" 1 "Woman Respondent", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(-1.5(.5)1.5, angle(45) labsize(3.5) grid) ytitle("`: variable label factordv'", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) 

*********************
* Figures A20 - A24 *
*********************
foreach dv in perform competent leadership fit contract { 
reg `dv' i.expwommg##i.reswoman expfemorg  $dem $manip 
eststo `dv'_3a
margins, over(expwommg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Man Respondent" 1 "Woman Respondent", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(1(1)10, angle(45) labsize(3.5) grid) ytitle("`: variable label `dv''", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. All respondents included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) 
}

*************
* Table A14 * 
*************
estout factordv_3a perform_3a competent_3a leadership_3a fit_3a contract_3a, ///
	cells(b(star fmt(3)) se(par)) ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels $labelsdem $labelsmanip)

*************************
* Figure 3 (Figure A25) *
*************************
reg factordv i.expwommg##i.expfemorg##i.reswoman 
eststo factordv_4
margins, over(expwommg expfemorg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(-1.5(.5)1.5, angle(45) labsize(3.5) grid) ytitle("`: variable label factordv'", size(3)) ///
byopt(title("Note: 95% confidence intervals shown.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) ///
legend(order(3 "Man Respondent" 4 "Woman Respondent") size(3))

* Pairwise comparisons test for Figure 3
margins, over(expwommg expfemorg reswoman) level(95) pwcompare(effects)

*********************
* Figures A26 - A30 *
*********************
foreach dv in perform competent leadership fit contract { 
reg `dv' i.expwommg##i.expfemorg##i.reswoman 
eststo `dv'_4
margins, over(expwommg expfemorg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(1(1)10, angle(45) labsize(3.5) grid) ytitle("`: variable label `dv''", size(3)) ///
byopt(title("Note: 95% confidence intervals shown.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) ///
legend(order(3 "Man Respondent" 4 "Woman Respondent") size(3))
}

*************
* Table A15 * 
*************
estout factordv_4 perform_4 competent_4 leadership_4 fit_4 contract_4, ///
	cells(b(star fmt(3)) se(par)) ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels)

**************
* Figure A31 *
**************
reg factordv i.expwommg##i.expfemorg##i.reswoman $dem $manip 
eststo factordv_4a
margins, over(expwommg expfemorg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(-1.5(.5)1.5, angle(45) labsize(3.5) grid) ytitle("`: variable label factordv'", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. Control variables included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) ///
legend(order(3 "Man Respondent" 4 "Woman Respondent") size(3))

*********************
* Figures A32 - A36 *
*********************
foreach dv in perform competent leadership fit contract { 
reg `dv' i.expwommg##i.expfemorg##i.reswoman $dem $manip
eststo `dv'_4a
margins, over(expwommg expfemorg reswoman) level(95)
marginsplot, recast(scatter) ///
bydimension(expwommg, elabels(1 "Man Manager" 2 "Woman Manager")) ///
xlabel(0 "Masculine Org" 1 "Feminine Org", angle(45) labsize(3.5)) xtitle("", size(0)) ///
ylabel(1(1)10, angle(45) labsize(3.5) grid) ytitle("`: variable label `dv''", size(3)) ///
byopt(title("Note: 95% confidence intervals shown. Control variables included.", size(2.5) position(6))) ///
scheme(s1mono) plotregion(margin(l+12 r+12)) ///
legend(order(3 "Man Respondent" 4 "Woman Respondent") size(3))
}

*************
* Table A16 *
*************
estout factordv_4a perform_4a competent_4a leadership_4a fit_4a contract_4a, ///
	cells(b(star fmt(3)) se(par)) ///
	starlevels (* 0.05 ** 0.01 *** 0.001) ///
	stats (r2 N , labels("R-squared" "Observations")) ///
	noomitted nobaselevels varlabels(_cons "Constant" $labels $labelsdem $labelsmanip)

